#ifndef BSP_UART_H
#define BSP_UART_H
#include "sym32l010_hal_sysctrl.h"
#include "sym32l010_hal_systick.h"
#include "sym32l010_hal_gpio.h"
#include "sym32l010_hal_uart.h"
#include "bsp_gpio.h"
#define TX_LEN 100
#define RX_LEN 100


extern uint8_t uart1_txbuf[TX_LEN],uart1_rxbuf[RX_LEN];
extern uint8_t uart2_txbuf[TX_LEN],uart2_rxbuf[RX_LEN];
typedef struct
{
    uint8_t uart_num;//0:UART1,1:UART2
    bsp_gpio_init_t* gpio_tx;
    bsp_gpio_init_t* gpio_rx;
    uint32_t baudrate;
    uint8_t stopbits;
    uint8_t firstbit;
    uint8_t start_edge;
    uint8_t parity;
    uint8_t datawidth;
    uint8_t cts_rts;
    uint8_t *txbuf;
    uint8_t *rxbuf;
}bsp_uart_init_t;
void HAL_UART1_IRQHandler(void);
void HAL_UART2_IRQHandler(void);
uint8_t Check_Uart2_Rx_empty(void);
uint8_t Get_Uart2_Rx_data(void);
int32_t bsp_uart_init(bsp_uart_init_t * uart_instance);
int32_t bsp_uart_deinit(bsp_uart_init_t * uart_instance);
int32_t bsp_uart_send(bsp_uart_init_t * uart_instance, uint8_t * data, uint16_t len);
#endif
